# -*- coding: utf-8 -*-
from cmsdj.categories.models import Category

def categories(request): 
    if hasattr(request, 'categories'): 
        return {'categories':request.categories }
    else:
        return {'categories':Category.get_roots() }
    
def categories_all_context(request): 
    if hasattr(request, 'categories_all_context'): 
        return {'categories_all_context':request.categories_all_context }
    else:
        return {'categories_all_context': Category.all(9) }